function rendered(titles, data) {
  var dt = '<table>\n';
  
  for (i = 0; i < titles.length; i++) {
    dt += '  <th>' + titles[i] + '</th>\n';
  }
  
  for (i = 0; i < data.length; i++) {
    dt += '  <tr>\n';
    for (j = 0; j < data[0].length; j++) {
      dt += '    <td>' + data[i][j] + '</td>\n';
    }
    dt += '  </tr>\n';
  }

  dt += '</table>';
  return dt;
}

exports.rendered = rendered
